<?php
/*
 * @Author: CHINAKAIYUAN<sunkaiyuan@namenode.cn>
 * @Date: 2022-02-03 01:16:57
 * @LastEditTime: 2023-07-16 09:16:45
 * @LastEditors: 孙开源 && sunkaiyuan@namenode.cn
 * @Description: 盘点单
 */

namespace App\Models;

use App\Traits\MaterialTrait;
use App\Traits\StorageTrait;
use App\Traits\AutoCodeTrait;
use App\Traits\SoftDeletesTrait;

class MpcOtherDetail extends BaseModel
    {
    use SoftDeletesTrait;
    use StorageTrait;
    use MaterialTrait;
    public $timestamps = true;
    public $table = "sys_mpc_other_detail";
    protected $guarded = [];
    protected $casts = [
        'storage_quantity'           => 'decimal:2',
        'storage_auxiliary_quantity' => 'decimal:2',
        'fect_auxiliary_quantity'    => 'decimal:2',
        'fect_quantity'              => 'decimal:2',
        'price'                      => 'decimal:2',
        'quantity'                   => 'decimal:2',
        'auxiliary_quantity'         => 'decimal:2',
    ];

    public function main()
        {
        return $this->belongsTo(MpcOther::class);
        }
    public function mpc_detail()
        {
        return $this->belongsTo(MpcSummaryDetail::class);
        }
    }